package com.maila.calltaxi.data;

/**
 * Created by Administrator on 2017/7/12.
 */

public class Status {

    private StatusListener broadListener;
    private  int status;
    private static Status varInstance;
    private Status(){

    }
    public static Status getInstance(){
        if(null==varInstance)
        {
            varInstance=new Status();
        }
        return varInstance;
    }

    public void setBroadListener(StatusListener broadListener){
        this.broadListener=broadListener;
    }
    /**
     * @return the var
     */
    public int getVar() {
        return status;
    }


    /**
     * @param var the var to set
     */
    public void setVar(int var) {
        this.status = var;
        if(null!=broadListener){
            broadListener.changeStatus(var);
        }
    }

    public  interface StatusListener{
        void changeStatus(int status);
    }
}
